package demo.msa.grpc.hello.server;

import io.grpc.Server;
import io.grpc.ServerBuilder;

import java.io.IOException;

public class HelloServer {

    private static final int port = 8000;

    public static void main(String[] args) throws IOException, InterruptedException {
        Server server = ServerBuilder.forPort(port).addService(new HelloServiceImpl()).build().start();
        System.out.println("server started, listening on " + port);
        System.out.println("HelloServer threadid = [" + Thread.currentThread().getId() + "]");
        server.awaitTermination();
    }
}
